Regular expression
http://msdn.microsoft.com/en-us/library/az24scfc.aspx =Regular Expression Language - Quick Reference= .NET Framework 4.5 Other Versions 10 out of 14 rated this helpful - Rate this topic A regular expression is a pattern that the regular expression engine attempts to match in input text. A pattern consists of one or more character literals, operators, or constructs. For a brief introduction, see .NET Framework Regular Expressions. Each section in this quick reference lists a particular category of characters, operators, and constructs that you can use to define regular expressions: *Character escapes *Character classes *Anchors *Grouping constructs *Quantifiers *Backreference constructs *Alternation constructs *Substitutions *Regular expression options *Miscellaneous constructs Character Escapes The backslash character (\) in a regular expression indicates that the character that follows it either is a special character (as shown in the following table), or should be interpreted literally. For more information, see Character Escapes in Regular Expressions. Back to top Character Classes A character class matches any one of a set of characters. Character classes include the language elements listed in the following table. For more information, see Character Classes in Regular Expressions. Back to top Anchors Anchors, or atomic zero-width assertions, cause a match to succeed or fail depending on the current position in the string, but they do not cause the engine to advance through the string or consume characters. The metacharacters listed in the following table are anchors. For more information, see Anchors in Regular Expressions. Back to top Grouping Constructs Grouping constructs delineate subexpressions of a regular expression and typically capture substrings of an input string. Grouping constructs include the language elements listed in the following table. For more information, see Grouping Constructs in Regular Expressions. Back to top Quantifiers A quantifier specifies how many instances of the previous element (which can be a character, a group, or a character class) must be present in the input string for a match to occur. Quantifiers include the language elements listed in the following table. For more information, see Quantifiers in Regular Expressions. Back to top Backreference Constructs A backreference allows a previously matched subexpression to be identified subsequently in the same regular expression. The following table lists the backreference constructs supported by regular expressions in the .NET Framework. For more information, see Backreference Constructs in Regular Expressions. Back to top Alternation Constructs Alternation constructs modify a regular expression to enable either/or matching. These constructs include the language elements listed in the following table. For more information, see Alternation Constructs in Regular Expressions. Back to top Substitutions Substitutions are regular expression language elements that are supported in replacement patterns. For more information, see Substitutions in Regular Expressions. The metacharacters listed in the following table are atomic zero-width assertions. Back to top Regular Expression Options You can specify options that control how the regular expression engine interprets a regular expression pattern. Many of these options can be specified either inline (in the regular expression pattern) or as one or more RegexOptions constants. This quick reference lists only inline options. For more information about inline and RegexOptions options, see the article Regular Expression Options. You can specify an inline option in two ways: *By using the miscellaneous construct(?imnsx-imnsx), where a minus sign (-) before an option or set of options turns those options off. For example, (?i-mn) turns case-insensitive matching (i) on, turns multiline mode (m) off, and turns unnamed group captures (n) off. The option applies to the regular expression pattern from the point at which the option is defined, and is effective either to the end of the pattern or to the point where another construct reverses the option. *By using the grouping construct(?imnsx-imnsx:subexpression), which defines options for the specified group only. The .NET Framework regular expression engine supports the following inline options. Back to top Miscellaneous Constructs Miscellaneous constructs either modify a regular expression pattern or provide information about it. The following table lists the miscellaneous constructs supported by the .NET Framework. For more information, see Miscellaneous Constructs in Regular Expressions. Category:regular expression